package cn.marinda.gui;

import cn.marinda.util.HttpUtils;

import javax.swing.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 文摘服务器对话框
 *
 * @author admin
 * @date 2022/07/14
 */
public abstract class AbstractServerDialog implements ServerDiaLog{
    protected JDialog dialog;
    protected JPanel view;
    protected int width;
    protected int height;
    protected List<JComponent> componentList = new ArrayList<>();
    protected String resource;
    protected Map<String,Boolean> radioData = new HashMap<>();
    protected Map<String,String> textData = new HashMap<>();
    protected String title;
    /**
     * 抽象服务器对话框
     */
    public AbstractServerDialog(){
        loadComponent();
        loadView();
        loadDialog();
        dialog.setIconImage(HttpUtils.loadLogo());
    }

    /**
     * 加载对话框
     *
     * @return {@link JDialog}
     */
    protected abstract JDialog loadDialog();

    protected abstract JPanel loadView();

    protected abstract List<JComponent> loadComponent();


}
